<template>
	<view>
		<!-- 医院列表 -->
		<view class="hospital flex justify-center" v-if="hospitalList.length>0">
			<view class="hospital-box">
				<view class="hospital-box-item flex justify-center" v-for="(item,index) in hospitalList" :key="index">
					<view class="hospital-box-item-c flex align-center justify-between">
						<view class="hospital-box-item-c-l">
							<image :src="item.hospitalImg?item.hospitalImg:'../../static/logo.png'" mode=""></image>
						</view>
						<view class="hospital-box-item-c-r flex flex-wrap align-center">
							<view class="hospital-box-item-c-r-title">{{item.hospitalName}}</view>
							<view class="hospital-box-item-c-r-info flex align-center">
								<text>{{item.hospitalLevel}}</text>|<span>{{item.hospitalType}}</span>
							</view>
							<view class="hospital-box-item-c-r-jj">{{item.hospitalDetails}}</view>
						</view>
					</view>


					<view class="hospital-box-item-b"
						:style="item.ordersIngCount > 0 ? 'background-color: red;' :'background-color: #4097DD'">
						{{item.ordersIngCount > 0 ? item.ordersIngCount +'个订单进行中': '暂无订单进行中'}}
					</view>


				</view>
			</view>
		</view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				hospitalList: []
			}
		},
		onLoad() {
			this.getList()
		},
		methods: {
			getList() {
				let data = {
					shopId: this.$queue.getData("shopId")
				}
				this.$Request.getA("/app/shop/shopHomePage", data).then(res => {
					if (res.code == 0) {
						if (res.data.serviceHospitalList && res.data.serviceHospitalList.length > 0) {
							this.hospitalList = res.data.serviceHospitalList
						}
						console.log(res.data.serviceHospitalList, 'res');

					}
				})
			}
		},
	}
</script>

<style lang="scss">
	.hospital {
		width: 100%;
		height: auto;
		// margin-top: 20rpx;

		.hospital-box {
			width: 686rpx;
			height: auto;
			margin-top: 20rpx;

			.hospital-box-item {
				width: 100%;
				height: 220rpx;
				border-radius: 16rpx;
				background-color: #ffffff;
				margin-bottom: 20rpx;

				position: relative;
				overflow: hidden;

				.hospital-box-item-b {
					position: absolute;
					top: 0;
					right: 0;
					color: white;
					height: 40rpx;
					// width: 200rpx;
					display: flex;
					justify-content: center;
					align-items: center;
					border-radius: 0 0 0 20rpx;
					padding: 0 10rpx;
				}

			}

			.hospital-box-item-c {
				width: calc(686rpx - 60rpx);
				height: 100%;
			}

			.hospital-box-item-c-l {
				width: 200rpx;
				height: 160rpx;

				image {
					width: 100%;
					height: 100%;
					border-radius: 10rpx;
				}
			}

			.hospital-box-item-c-r {
				width: 406rpx;
				height: 160rpx;
			}

			.hospital-box-item-c-r-title {
				width: 100%;
				color: #1E1F31;
				font-size: 32rpx;
				font-weight: bold;
			}

			.hospital-box-item-c-r-info {
				width: 100%;
				color: #666666;
				font-size: 26rpx;
				font-weight: 500;

				text {
					color: #FF574E;
					margin-right: 10rpx;
				}

				span {
					margin-left: 10rpx;
				}
			}

			.hospital-box-item-c-r-jj {
				width: 100%;
				color: #666666;
				font-size: 26rpx;
				font-weight: 500;
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;
			}
		}
	}
</style>